package engine.managers
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.ui.Mouse;

	public class ScreenManager
	{
		private var _stage:Stage;
		private var _gameContainer:Sprite;
		private var _sleepDisplay:Shape;
		private var _backgroundContainer:Sprite;
		private var _sceneContainer:Sprite;
		private var _foreGroundContainer:Sprite;
		private var _debugContainer:Sprite;
		
		public function ScreenManager(gameContainer:Sprite)
		{
			this._gameContainer = gameContainer;
			
			this._stage 			= this._gameContainer.stage;
			this._stage.frameRate 	= 60;
			this._stage.color 		= 0;
			this._stage.scaleMode 	= StageScaleMode.NO_SCALE;
			this._stage.align 		= StageAlign.TOP_LEFT;
			
			this._sleepDisplay = new Shape();
			this._sleepDisplay.name = "SleepDisplay";
			this._sleepDisplay.graphics.beginFill(0, 0);
			this._sleepDisplay.graphics.drawRect(0, 0, 1, 1);
			this._sleepDisplay.graphics.endFill();
			this._stage.addChild(this._sleepDisplay);
			
			this._backgroundContainer = new Sprite();
			this._backgroundContainer.mouseEnabled = false;
			this._backgroundContainer.name = "BackgroundContainer";
			this._stage.addChild(this._backgroundContainer);
			
			this._sceneContainer = new Sprite();
			this._sceneContainer.mouseEnabled = false;
			this._sceneContainer.name = "SceneContainer";
			this._stage.addChild(this._sceneContainer);
			
			this._foreGroundContainer = new Sprite();
			this._foreGroundContainer.mouseEnabled = false;
			this._foreGroundContainer.name = "ForegroundContainer";
			this._stage.addChild(this._foreGroundContainer);
			
			//Might want another container in here for loading screens...
			
			this._debugContainer = new Sprite();
			this._debugContainer.mouseEnabled = false;
			this._debugContainer.name = "DebugContainer";
			this._stage.addChild(this._debugContainer);
		}
		
		public final function get stage():Stage 								{ return this._stage; }
		public final function get gameContainer():DisplayObjectContainer		{ return this._gameContainer; }
		public final function get sleepDisplay():Shape							{ return this._sleepDisplay; }
		public final function get backgroundContainer():DisplayObjectContainer 	{ return this._backgroundContainer; }
		public final function get sceneContainer():DisplayObjectContainer 		{ return this._sceneContainer; }
		public final function get foregroundContainer():DisplayObjectContainer 	{ return this._foreGroundContainer; }
		public final function get debugContainer():DisplayObjectContainer 		{ return this._debugContainer; }
	}
}